package com.ktjy.test1;

import net.sf.cglib.proxy.Enhancer;

/**
 * @author:雷淑娥
 * @Date:2024/12/11 20:29
 * version:1.0
 */
public class LogFactory {
    public static <T> T crate(Object obj){
        LoggingInvocationHandler loggingInvocationHandler=new LoggingInvocationHandler();
        Enhancer enhancer=new Enhancer();
        enhancer.setCallback(loggingInvocationHandler);
        enhancer.setSuperclass(obj.getClass());
        return (T) enhancer.create();
    }
}
